package com.imti.mall.order.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.imti.mall.model.order.pojo.OmsCartItem;
import com.imti.mall.order.mapper.CartItemMapper;
import com.imti.mall.order.service.CartItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class CartItemServiceImpl extends ServiceImpl<CartItemMapper,OmsCartItem> implements CartItemService {

    @Autowired
    private CartItemMapper cartItemMapper;

    @Override
    public int addCartItem(OmsCartItem omsCartItem) {
        return cartItemMapper.addCartItem(omsCartItem);
    }

    @Override
    public int updateCartItem(OmsCartItem omsCartItem) {
        return cartItemMapper.updateCartItem(omsCartItem);
    }

    @Override
    public List<OmsCartItem> cartItemList(Long memberId, Long productSkuId) {
        return cartItemMapper.cartItemList(memberId,productSkuId);
    }

    @Override
    public OmsCartItem cartItem(Long memberId, Long productSkuId) {
        return cartItemMapper.cartItem(memberId,productSkuId);
    }

    @Override
    public Integer quantity(Long memberId, Long productId) {
        return cartItemMapper.quantity(memberId,productId);
    }

    @Override
    public int updateDeleteStatus(Long id) {
        return cartItemMapper.updateDeleteStatus(id);
    }

}